//
//  SearchListCell.m
//  BaseAPP
//
//  Created by Evisu on 16/12/26.
//  Copyright © 2016年 evisum. All rights reserved.
//

#import "SearchListCell.h"

@implementation SearchListCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {

    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self initViews];
        [self layoutViews];
    }
    
    return self;
}

- (void)initViews {

    self.ivSearchIcon = [[UIImageView alloc] init];
    self.ivSearchIcon.image = [UIImage imageNamed:@"fts_websearch_icon@2x"];
    
    self.labSearch = [[UILabel alloc] init];
    self.labSearch.text = @"搜索：";
    self.labSearch.font = [UIFont systemFontOfSize:14.0];
    self.labSearch.textColor = HEXColor(@"1e1e1e");
    
    self.labSearchText = [[UILabel alloc] init];
    self.labSearchText.font = [UIFont systemFontOfSize:14.0];
    self.labSearchText.textColor = HEXColor(@"11891e");
    
    [self.contentView addSubview:self.ivSearchIcon];
    [self.contentView addSubview:self.labSearch];
    [self.contentView addSubview:self.labSearchText];
}


- (void)layoutViews {

    self.ivSearchIcon.sd_layout
    .centerYEqualToView(self.contentView)
    .leftSpaceToView(self.contentView, 16)
    .heightIs(50)
    .widthIs(50);
    
    self.labSearch.sd_layout
    .centerYEqualToView(self.contentView)
    .leftSpaceToView(self.ivSearchIcon, 10)
    .heightIs(14);
    
    self.labSearchText.sd_layout
    .centerYEqualToView(self.contentView)
    .leftSpaceToView(self.ivSearchIcon, 58)
    .rightSpaceToView(self.contentView, 16)
    .heightIs(14);
    
}

- (void)setSearchStr:(NSString *)searchStr {

    _searchStr = searchStr;
    
    self.labSearchText.text = searchStr;
}

@end
